//  header_bottom/艺术品
var arts = $(".arts");
// console.log(arts);
arts.on("mouseover",function(){
  $(".art_class").stop().slideDown(500);
}).on("mouseout",function(){
  $(".art_class").stop().slideUp(500);
})
//下拉 header 部分样式
$(window).on("scroll",function(){
  if($(document).scrollTop() > 0){
    $(".header_hidden").fadeIn();
    $(".header_bottom").stop().slideUp();
    $("header").stop().animate({
      "height":"60px"
    },0)
  }else{
    $(".header_hidden").fadeOut();
    $(".header_bottom").stop().slideDown(500);
    $("header").stop().animate({
      "height":"100px"
    })
  }
})
//下拉滚动条右边栏显示
$(window).on("scroll",function(){
  if($(document).scrollTop() < 200){
    $(".right_help").fadeOut(500);
  }else{
    $(".right_help").fadeIn(500);
  }
})

// 点击客服 / 打开留言弹出框
var contact_service1 = $(".customer_service");
contact_service1.on("click",function(){
  $(".leave_message").css({"display":"block"});
})

// 点击在线客服 / 打开留言弹出框
var contact_service2 = $(".online_service");
contact_service2.on("click",function(){
  $(".leave_message").css({"display":"block"});
})


// 点击关闭和最小化 / 关闭隐藏留言框
var leave_message_btn = $(".leave_msg_top img");
leave_message_btn.on("click",function(){
  $(".leave_message").css({"display":"none"});
})

// 移动留言框
var leave_message = $(".leave_message"),
    x1 = 0,
    y1 = 0;
leave_message.on("dragstart",function(){
  x1 = event.offsetX;
  y1 = event.offsetY;
  // console.log(x1,y1);
}).on("drag",function(){
  var x2 = event.pageX,
      y2 = event.pageY;
  // console.log(x2,y2);
  $(this).offset({
    top:y2 - y1,
    left:x2 - x1
  })
}).on("dragend",function(){
  var x2 = event.pageX,
      y2 = event.pageY;
  // console.log(x2,y2);
  $(this).offset({
    top:y2 - y1,
    left:x2 - x1
  })
})